package net.wwang.blog.service;

import net.wwang.blog.pojo.User;
import net.wwang.blog.commons.global.ResponseResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description:
 * @Author: WangWei
 */
public interface UserService {

    ResponseResult initManagerAccount(User user, HttpServletRequest request);

    void createCaptcha(HttpServletResponse response, String captchaKey) throws Exception;

    ResponseResult sendEmail(HttpServletRequest request, String emailAdress,String type);

    ResponseResult register(HttpServletRequest request,User user,String verifyCode,String captchaCode,String captchaKey);

    ResponseResult login(String captcha, String captchaKey, User user, HttpServletRequest request, HttpServletResponse response);

    User checkUserState(HttpServletRequest request,HttpServletResponse response);

    ResponseResult getUserInfo(String userId);

    ResponseResult checkEmail(String email);

    ResponseResult checkUsername(String username);

    ResponseResult updateUserInfo(HttpServletRequest request, HttpServletResponse response, String userId, User user);

    ResponseResult deleteUser(HttpServletRequest request, HttpServletResponse response, String userId);

    ResponseResult getUserList(int page, int size, HttpServletRequest request, HttpServletResponse response);

    ResponseResult updateUserPassword(String verifyCode, User user);

    ResponseResult updateEmailAdress(String verifyCode, String email,HttpServletRequest request,HttpServletResponse response);

    ResponseResult logout();

}
